package examen2;

public class OrdenamientoSeleccion {

	public void ordenar(int[] vector){
		
		int ultimoIndice = vector.length -1 ;
		
		while(ultimoIndice > 0){
			int maximo = ultimoIndice;
			for(int i = 0; i < ultimoIndice ; i++){
				if(vector[i] > vector[maximo]){
					maximo = i;
				}
			}
			intercambiarPosiciones(vector, ultimoIndice, maximo);
			ultimoIndice--;
		}
		
	}
	
	public void intercambiarPosiciones(int[] vector,int i, int j){
		int auxiliar = vector[i];
		vector[i] = vector[j];
		vector[j] = auxiliar;
	}
}
